package com.easemob.util;

import android.content.Context;
import android.content.res.Resources;
import android.util.DisplayMetrics;

public class DensityUtil
{
  public static int dip2px(Context paramContext, float paramFloat)
  {
    float f = paramContext.getResources().getDisplayMetrics().density;
    return (int)(paramFloat * f + 0.5F);
  }

  public static int px2dip(Context paramContext, float paramFloat)
  {
    float f = paramContext.getResources().getDisplayMetrics().density;
    return (int)(paramFloat / f + 0.5F);
  }

  public static int sp2px(Context paramContext, float paramFloat)
  {
    float f = paramContext.getResources().getDisplayMetrics().scaledDensity;
    return (int)(paramFloat * f + 0.5F);
  }

  public static int px2sp(Context paramContext, float paramFloat)
  {
    float f = paramContext.getResources().getDisplayMetrics().scaledDensity;
    return (int)(paramFloat / f + 0.5F);
  }
}

/* Location:           D:\hygieia\userclient\common\libs\easemobchat_2.1.8.jar
 * Qualified Name:     com.easemob.util.DensityUtil
 * JD-Core Version:    0.6.1
 */